/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades.grafo;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;

/**
 *
 * @author Gabriel
 */
public class Nodo {
    private int posX;
    private int posY;

    private int width;
    private int height;

    private String contenido;

    private int posContenidoX;
    private int posContenidoY;

    public Graphics2D dibujar(Graphics2D g){
        posContenidoX= posX + (width/2) - 3;
        posContenidoY= posY + (height/2) + 3;
        g.setColor(Color.WHITE);
        g.fill(new Ellipse2D.Double(posX, posY, width, height));
        g.setColor(Color.BLACK);
        g.drawString(contenido,posContenidoX, posContenidoY);
        g.drawOval(posX, posY, width, height);
        return g;
    }
    
    /********************* MÉTODOS SETTERS Y GETTERS **************************/
    public int getPosX(){ return posX; }
    public int getPosY(){ return posY; }
    public int getWidth(){ return width; }
    public int getHeight(){ return height; }
    public String getContenido(){ return contenido;}

    public void setPosX(int posX){ this.posX = posX; }
    public void setPosY(int posY){ this.posY = posY; }
    public void setWidth(int width){ this.width = width; }
    public void setHeight(int height){ this.height = height; }
    public void setContenido(String contenido){ this.contenido = contenido; }
}
